package com.ruoze.bdp.utils;


public class ServiceException extends RuntimeException{
    private static final long serialVersionUID = -4575692308128236204L;
    private String code;
    private String msg;

    public ServiceException(Exception e) {
        this.msg = e.getMessage();
    }

    public ServiceException(String code) {
        super(MessageConverterUtil.getMessage(code));
        this.code = code;
        this.msg = MessageConverterUtil.getMessage(code);
    }

    public ServiceException(String code, String message) {
        super(code + ":" + message);
        this.code = code;
        this.msg = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
